package com.qk.management.mapper;

import com.qk.entity.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface RoleMapper {
    List<Role> selectByPage(String name, String label);

    @Insert("INSERT INTO role(name, label,remark, create_time, update_time) VALUES(#{name}, #{label},#{remark}, #{createTime}, #{updateTime})")
    void insert(Role role);

    @Select("SELECT * FROM role WHERE id = #{id}")
    Role getById(Integer id);

    void updateRole(Role role);

    @Delete("DELETE FROM role WHERE id = #{id}")
    void deleteRole(Integer id);

    @Select("SELECT * FROM role")
    List<Role> selectAll();
}
